package com.mapper;

import com.pojo.Orders;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 海棠凤梨
* @description 针对表【tb_orders】的数据库操作Mapper
* @createDate 2024-11-15 15:10:03
* @Entity com.pojo.Orders
*/
public interface OrdersMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Orders record);

    int insertSelective(Orders record);

    Orders selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Orders record);

    int updateByPrimaryKey(Orders record);

    @Select("select  * from tb_orders where user_id = #{id}")
    @Results({
            @Result(id = true, column = "id",property = "id"),
            @Result(column = "number",property = "number"),
    })
    List<Orders> selectOrderByUserId(int id);
}
